#define RandomMask1_1 \
  0x80, 0x00

#define RandomMask2_1 \
  0xc0, 0x00

#define RandomMask2_2 \
  0xc0, 0x00, \
  0x80, 0x00

#define RandomMask3_1 \
  0xe0, 0x00

#define RandomMask3_2 \
  0xc0, 0x00, \
  0xa0, 0x00

#define RandomMask3_3 \
  0xc0, 0x00, \
  0xa0, 0x00, \
  0x60, 0x00

#define RandomMask4_1 \
  0xf0, 0x00

#define RandomMask4_2 \
  0xc0, 0x00, \
  0xb0, 0x00

#define RandomMask4_3 \
  0xc0, 0x00, \
  0xb0, 0x00, \
  0x60, 0x00

#define RandomMask4_4 \
  0xc0, 0x00, \
  0xa0, 0x00, \
  0x30, 0x00, \
  0x50, 0x00

#define RandomMask5_1 \
  0xf8, 0x00

#define RandomMask5_2 \
  0xa8, 0x00, \
  0xd0, 0x00

#define RandomMask5_3 \
  0xb0, 0x00, \
  0xc8, 0x00, \
  0x50, 0x00

#define RandomMask5_4 \
  0xc8, 0x00, \
  0xb0, 0x00, \
  0x50, 0x00, \
  0x28, 0x00

#define RandomMask5_5 \
  0xc0, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0xa0, 0x00, \
  0x48, 0x00

#define RandomMask6_1 \
  0xfc, 0x00

#define RandomMask6_2 \
  0xa8, 0x00, \
  0xd4, 0x00

#define RandomMask6_3 \
  0xd0, 0x00, \
  0x68, 0x00, \
  0xa4, 0x00

#define RandomMask6_4 \
  0xa8, 0x00, \
  0x58, 0x00, \
  0x64, 0x00, \
  0x94, 0x00

#define RandomMask6_5 \
  0xa8, 0x00, \
  0x84, 0x00, \
  0x64, 0x00, \
  0x90, 0x00, \
  0x58, 0x00

#define RandomMask6_6 \
  0x98, 0x00, \
  0x64, 0x00, \
  0x50, 0x00, \
  0x14, 0x00, \
  0xa8, 0x00, \
  0xe0, 0x00

#define RandomMask7_1 \
  0xfe, 0x00

#define RandomMask7_2 \
  0xd4, 0x00, \
  0xaa, 0x00

#define RandomMask7_3 \
  0xd0, 0x00, \
  0xaa, 0x00, \
  0x64, 0x00

#define RandomMask7_4 \
  0xd0, 0x00, \
  0xaa, 0x00, \
  0x64, 0x00, \
  0x1c, 0x00

#define RandomMask7_5 \
  0x0c, 0x00, \
  0xb0, 0x00, \
  0x1a, 0x00, \
  0xc4, 0x00, \
  0x62, 0x00

#define RandomMask7_6 \
  0x8c, 0x00, \
  0x4a, 0x00, \
  0x64, 0x00, \
  0xd0, 0x00, \
  0xa0, 0x00, \
  0x32, 0x00

#define RandomMask7_7 \
  0x4a, 0x00, \
  0x94, 0x00, \
  0x1a, 0x00, \
  0xc4, 0x00, \
  0x28, 0x00, \
  0xc2, 0x00, \
  0x34, 0x00

#define RandomMask8_1 \
  0xff, 0x00

#define RandomMask8_2 \
  0xaa, 0x00, \
  0xd5, 0x00

#define RandomMask8_3 \
  0xc5, 0x00, \
  0x92, 0x00, \
  0x6a, 0x00

#define RandomMask8_4 \
  0x45, 0x00, \
  0xb4, 0x00, \
  0x6a, 0x00, \
  0x89, 0x00

#define RandomMask8_5 \
  0x8c, 0x00, \
  0x92, 0x00, \
  0x2b, 0x00, \
  0x51, 0x00, \
  0x64, 0x00

#define RandomMask8_6 \
  0xa1, 0x00, \
  0x52, 0x00, \
  0x91, 0x00, \
  0x2a, 0x00, \
  0xc4, 0x00, \
  0x4c, 0x00

#define RandomMask8_7 \
  0x15, 0x00, \
  0xc2, 0x00, \
  0x25, 0x00, \
  0x62, 0x00, \
  0x58, 0x00, \
  0x8c, 0x00, \
  0xa3, 0x00

#define RandomMask8_8 \
  0x25, 0x00, \
  0x8a, 0x00, \
  0x91, 0x00, \
  0x68, 0x00, \
  0x32, 0x00, \
  0x43, 0x00, \
  0xc4, 0x00, \
  0x1c, 0x00

#define RandomMask9_1 \
  0xff, 0x80

#define RandomMask9_2 \
  0xaa, 0x80, \
  0xd5, 0x00

#define RandomMask9_3 \
  0xa5, 0x00, \
  0xc8, 0x00, \
  0x52, 0x80

#define RandomMask9_4 \
  0xa2, 0x00, \
  0xc9, 0x00, \
  0x52, 0x80, \
  0x24, 0x80

#define RandomMask9_5 \
  0x8c, 0x00, \
  0x25, 0x00, \
  0x92, 0x80, \
  0x41, 0x80, \
  0x58, 0x00

#define RandomMask9_6 \
  0x84, 0x80, \
  0x27, 0x00, \
  0x51, 0x80, \
  0x1a, 0x00, \
  0x68, 0x00, \
  0x89, 0x00

#define RandomMask9_7 \
  0x8c, 0x00, \
  0x47, 0x00, \
  0x81, 0x80, \
  0x12, 0x80, \
  0x58, 0x00, \
  0x28, 0x80, \
  0xb4, 0x00

#define RandomMask9_8 \
  0x2c, 0x00, \
  0x91, 0x00, \
  0x40, 0x80, \
  0x06, 0x80, \
  0xc8, 0x00, \
  0x45, 0x00, \
  0x30, 0x80, \
  0xa2, 0x00

#define RandomMask9_9 \
  0x4c, 0x00, \
  0x62, 0x00, \
  0x91, 0x00, \
  0x42, 0x80, \
  0xa4, 0x00, \
  0x13, 0x00, \
  0x30, 0x80, \
  0x88, 0x80, \
  0x09, 0x00

#define RandomMask10_1 \
  0xff, 0xc0

#define RandomMask10_10 \
  0x4c, 0x00, \
  0x51, 0x00, \
  0xa0, 0x40, \
  0x04, 0xc0, \
  0x03, 0x80, \
  0x86, 0x00, \
  0x29, 0x00, \
  0x42, 0x40, \
  0x98, 0x00, \
  0x30, 0x80

#define RandomMask10_2 \
  0xaa, 0x80, \
  0xd5, 0x40

#define RandomMask10_3 \
  0xa4, 0x40, \
  0xc9, 0x00, \
  0x52, 0x80

#define RandomMask10_4 \
  0xca, 0x00, \
  0x32, 0x80, \
  0xa1, 0x40, \
  0x55, 0x00

#define RandomMask10_5 \
  0xca, 0x00, \
  0x32, 0x80, \
  0xa1, 0x40, \
  0x55, 0x00, \
  0x08, 0xc0

#define RandomMask10_6 \
  0x0e, 0x00, \
  0x33, 0x00, \
  0x10, 0xc0, \
  0x45, 0x40, \
  0x88, 0x80, \
  0xe0, 0x00

#define RandomMask10_7 \
  0x46, 0x00, \
  0x33, 0x00, \
  0x80, 0xc0, \
  0x0c, 0x40, \
  0x28, 0x80, \
  0x94, 0x00, \
  0xc1, 0x00

#define RandomMask10_8 \
  0x2c, 0x00, \
  0x81, 0x80, \
  0xa0, 0x40, \
  0x05, 0x40, \
  0x18, 0x80, \
  0xc2, 0x00, \
  0x22, 0x80, \
  0x50, 0x40

#define RandomMask10_9 \
  0x4c, 0x00, \
  0x23, 0x00, \
  0x88, 0xc0, \
  0x21, 0x40, \
  0x52, 0x80, \
  0x94, 0x00, \
  0x26, 0x00, \
  0x48, 0x40, \
  0x91, 0x80

#define RandomMask11_1 \
  0xff, 0xe0

#define RandomMask11_10 \
  0x64, 0x40, \
  0x51, 0x40, \
  0xa9, 0x00, \
  0x04, 0xc0, \
  0xd0, 0x00, \
  0x82, 0x40, \
  0x21, 0x20, \
  0x0c, 0x20, \
  0x4a, 0x00, \
  0x12, 0xa0

#define RandomMask11_11 \
  0x46, 0x40, \
  0x33, 0x20, \
  0x99, 0x00, \
  0x05, 0x80, \
  0x80, 0xa0, \
  0x84, 0x40, \
  0x40, 0x60, \
  0x0a, 0x80, \
  0x68, 0x00, \
  0x10, 0x20, \
  0x30, 0x40

#define RandomMask11_2 \
  0xec, 0xc0, \
  0x9b, 0xa0

#define RandomMask11_3 \
  0xca, 0xc0, \
  0xf1, 0x40, \
  0xb6, 0x20

#define RandomMask11_4 \
  0xc4, 0xc0, \
  0x31, 0x60, \
  0x4b, 0x20, \
  0x2c, 0xa0

#define RandomMask11_5 \
  0x86, 0x80, \
  0x23, 0x20, \
  0x16, 0x20, \
  0x4c, 0x20, \
  0x41, 0xc0

#define RandomMask11_6 \
  0x64, 0x40, \
  0x51, 0x40, \
  0x0c, 0xa0, \
  0xa1, 0x20, \
  0x12, 0xa0, \
  0x8a, 0x40

#define RandomMask11_7 \
  0x46, 0x40, \
  0x33, 0x20, \
  0x91, 0x80, \
  0xa4, 0x20, \
  0x50, 0xa0, \
  0x84, 0xc0, \
  0x09, 0x60

#define RandomMask11_8 \
  0x0c, 0x80, \
  0x80, 0x60, \
  0xa0, 0x80, \
  0x05, 0x40, \
  0x43, 0x00, \
  0x1a, 0x00, \
  0x60, 0x20, \
  0x14, 0x20

#define RandomMask11_9 \
  0x46, 0x40, \
  0x62, 0x60, \
  0x8c, 0x00, \
  0x01, 0x60, \
  0x07, 0x80, \
  0xa0, 0x80, \
  0x18, 0xa0, \
  0x91, 0x00, \
  0x78, 0x00

#define RandomMask12_1 \
  0xff, 0xf0

#define RandomMask12_10 \
  0x51, 0x40, \
  0x45, 0x10, \
  0x80, 0xd0, \
  0x24, 0x20, \
  0x0a, 0x20, \
  0x00, 0xe0, \
  0xb8, 0x00, \
  0x09, 0x10, \
  0x56, 0x00, \
  0xa2, 0x80

#define RandomMask12_11 \
  0x53, 0x60, \
  0x21, 0x30, \
  0x10, 0x90, \
  0x00, 0x70, \
  0x0c, 0x10, \
  0x40, 0xc0, \
  0x6a, 0x00, \
  0x86, 0x00, \
  0x24, 0x80, \
  0x89, 0x00, \
  0xc0, 0x20

#define RandomMask12_12 \
  0x10, 0x60, \
  0x02, 0x30, \
  0x40, 0x50, \
  0x21, 0x80, \
  0x81, 0x10, \
  0x14, 0x80, \
  0x98, 0x00, \
  0x08, 0x90, \
  0x62, 0x00, \
  0x24, 0x20, \
  0x8a, 0x00, \
  0x84, 0x40

#define RandomMask12_2 \
  0xec, 0xc0, \
  0x93, 0xb0

#define RandomMask12_3 \
  0x9b, 0x80, \
  0x4f, 0x10, \
  0x3c, 0x60

#define RandomMask12_4 \
  0x8b, 0x20, \
  0x14, 0xb0, \
  0x22, 0xd0, \
  0x45, 0x50

#define RandomMask12_5 \
  0x53, 0x60, \
  0x64, 0x20, \
  0x0c, 0xc0, \
  0x82, 0xa0, \
  0x09, 0x30

#define RandomMask12_6 \
  0x51, 0x40, \
  0xc5, 0x10, \
  0x21, 0x80, \
  0x12, 0x30, \
  0x08, 0xe0, \
  0x2e, 0x00

#define RandomMask12_7 \
  0x53, 0x60, \
  0x21, 0x30, \
  0x90, 0x90, \
  0x02, 0x50, \
  0x06, 0xa0, \
  0x2c, 0x00, \
  0x88, 0x60

#define RandomMask12_8 \
  0x20, 0x60, \
  0x80, 0x30, \
  0x42, 0x40, \
  0x01, 0x90, \
  0x14, 0x10, \
  0x0a, 0x80, \
  0x38, 0x00, \
  0xc5, 0x00

#define RandomMask12_9 \
  0x53, 0x60, \
  0xe4, 0x20, \
  0x24, 0x40, \
  0xa1, 0x10, \
  0x18, 0x30, \
  0x03, 0x90, \
  0x8a, 0x10, \
  0x04, 0x90, \
  0x00, 0xe0

// choose second idx of packet mask according to n-k value (repair number)
#define RandomPacketMask1 1, \
  RandomMask1_1

#define RandomPacketMask2 2, \
  RandomMask2_1, \
  RandomMask2_2

#define RandomPacketMask3 3, \
  RandomMask3_1, \
  RandomMask3_2, \
  RandomMask3_3

#define RandomPacketMask4 4, \
  RandomMask4_1, \
  RandomMask4_2, \
  RandomMask4_3, \
  RandomMask4_4

#define RandomPacketMask5 5, \
  RandomMask5_1, \
  RandomMask5_2, \
  RandomMask5_3, \
  RandomMask5_4, \
  RandomMask5_5

#define RandomPacketMask6 6, \
  RandomMask6_1, \
  RandomMask6_2, \
  RandomMask6_3, \
  RandomMask6_4, \
  RandomMask6_5, \
  RandomMask6_6

#define RandomPacketMask7 7, \
  RandomMask7_1, \
  RandomMask7_2, \
  RandomMask7_3, \
  RandomMask7_4, \
  RandomMask7_5, \
  RandomMask7_6, \
  RandomMask7_7

#define RandomPacketMask8 8, \
  RandomMask8_1, \
  RandomMask8_2, \
  RandomMask8_3, \
  RandomMask8_4, \
  RandomMask8_5, \
  RandomMask8_6, \
  RandomMask8_7, \
  RandomMask8_8

#define RandomPacketMask9 9, \
  RandomMask9_1, \
  RandomMask9_2, \
  RandomMask9_3, \
  RandomMask9_4, \
  RandomMask9_5, \
  RandomMask9_6, \
  RandomMask9_7, \
  RandomMask9_8, \
  RandomMask9_9

#define RandomPacketMask10 10, \
  RandomMask10_1, \
  RandomMask10_2, \
  RandomMask10_3, \
  RandomMask10_4, \
  RandomMask10_5, \
  RandomMask10_6, \
  RandomMask10_7, \
  RandomMask10_8, \
  RandomMask10_9, \
  RandomMask10_10

#define RandomPacketMask11 11, \
  RandomMask11_1, \
  RandomMask11_2, \
  RandomMask11_3, \
  RandomMask11_4, \
  RandomMask11_5, \
  RandomMask11_6, \
  RandomMask11_7, \
  RandomMask11_8, \
  RandomMask11_9, \
  RandomMask11_10, \
  RandomMask11_11

#define RandomPacketMask12 12, \
  RandomMask12_1, \
  RandomMask12_2, \
  RandomMask12_3, \
  RandomMask12_4, \
  RandomMask12_5, \
  RandomMask12_6, \
  RandomMask12_7, \
  RandomMask12_8, \
  RandomMask12_9, \
  RandomMask12_10, \
  RandomMask12_11, \
  RandomMask12_12


#define BurstMask1_1 \
  0x80, 0x00

#define BurstMask2_1 \
  0xc0, 0x00

#define BurstMask2_2 \
  0x80, 0x00, \
  0xc0, 0x00

#define BurstMask3_1 \
  0xe0, 0x00

#define BurstMask3_2 \
  0xc0, 0x00, \
  0xa0, 0x00

#define BurstMask3_3 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00

#define BurstMask4_1 \
  0xf0, 0x00

#define BurstMask4_2 \
  0xa0, 0x00, \
  0xd0, 0x00

#define BurstMask4_3 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x90, 0x00

#define BurstMask4_4 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00

#define BurstMask5_1 \
  0xf8, 0x00

#define BurstMask5_2 \
  0xd0, 0x00, \
  0xa8, 0x00

#define BurstMask5_3 \
  0x70, 0x00, \
  0x90, 0x00, \
  0xc8, 0x00

#define BurstMask5_4 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x88, 0x00

#define BurstMask5_5 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00

#define BurstMask6_1 \
  0xfc, 0x00

#define BurstMask6_2 \
  0xa8, 0x00, \
  0xd4, 0x00

#define BurstMask6_3 \
  0x94, 0x00, \
  0xc8, 0x00, \
  0x64, 0x00

#define BurstMask6_4 \
  0x60, 0x00, \
  0x38, 0x00, \
  0x88, 0x00, \
  0xc4, 0x00

#define BurstMask6_5 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x84, 0x00

#define BurstMask6_6 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00

#define BurstMask7_1 \
  0xfe, 0x00

#define BurstMask7_2 \
  0xd4, 0x00, \
  0xaa, 0x00

#define BurstMask7_3 \
  0xc8, 0x00, \
  0x74, 0x00, \
  0x92, 0x00

#define BurstMask7_4 \
  0x38, 0x00, \
  0x8a, 0x00, \
  0xc4, 0x00, \
  0x62, 0x00

#define BurstMask7_5 \
  0x60, 0x00, \
  0x30, 0x00, \
  0x1c, 0x00, \
  0x84, 0x00, \
  0xc2, 0x00

#define BurstMask7_6 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x82, 0x00

#define BurstMask7_7 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00

#define BurstMask8_1 \
  0xff, 0x00

#define BurstMask8_2 \
  0xaa, 0x00, \
  0xd5, 0x00

#define BurstMask8_3 \
  0x74, 0x00, \
  0x92, 0x00, \
  0xc9, 0x00

#define BurstMask8_4 \
  0x8a, 0x00, \
  0xc5, 0x00, \
  0x62, 0x00, \
  0x31, 0x00

#define BurstMask8_5 \
  0x30, 0x00, \
  0x1c, 0x00, \
  0x85, 0x00, \
  0xc2, 0x00, \
  0x61, 0x00

#define BurstMask8_6 \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0e, 0x00, \
  0x82, 0x00, \
  0xc1, 0x00

#define BurstMask8_7 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x81, 0x00

#define BurstMask8_8 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00

#define BurstMask9_1 \
  0xff, 0x80

#define BurstMask9_2 \
  0xd5, 0x00, \
  0xaa, 0x80

#define BurstMask9_3 \
  0x92, 0x00, \
  0xc9, 0x00, \
  0x74, 0x80

#define BurstMask9_4 \
  0xc5, 0x00, \
  0x62, 0x00, \
  0x39, 0x00, \
  0x8a, 0x80

#define BurstMask9_5 \
  0x1c, 0x00, \
  0x85, 0x00, \
  0xc2, 0x80, \
  0x61, 0x00, \
  0x30, 0x80

#define BurstMask9_6 \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0e, 0x00, \
  0x82, 0x80, \
  0xc1, 0x00, \
  0x60, 0x80

#define BurstMask9_7 \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x07, 0x00, \
  0x81, 0x00, \
  0xc0, 0x80

#define BurstMask9_8 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x80, 0x80

#define BurstMask9_9 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80

#define BurstMask10_1 \
  0xff, 0xc0

#define BurstMask10_2 \
  0xaa, 0x80, \
  0xd5, 0x40

#define BurstMask10_3 \
  0xc9, 0x00, \
  0x74, 0x80, \
  0x92, 0x40

#define BurstMask10_4 \
  0x62, 0x00, \
  0x39, 0x00, \
  0x8a, 0x80, \
  0xc5, 0x40

#define BurstMask10_5 \
  0x85, 0x00, \
  0xc2, 0x80, \
  0x61, 0x40, \
  0x30, 0x80, \
  0x18, 0x40

#define BurstMask10_6 \
  0x18, 0x00, \
  0x0e, 0x00, \
  0x82, 0x80, \
  0xc1, 0x40, \
  0x60, 0x80, \
  0x30, 0x40

#define BurstMask10_7 \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x07, 0x00, \
  0x81, 0x40, \
  0xc0, 0x80, \
  0x60, 0x40

#define BurstMask10_8 \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x80, 0x80, \
  0xc0, 0x40

#define BurstMask10_9 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x80, 0x40

#define BurstMask10_10 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x00, 0xc0

#define BurstMask11_1 \
  0xff, 0xe0

#define BurstMask11_2 \
  0xd5, 0x40, \
  0xaa, 0xa0

#define BurstMask11_3 \
  0x74, 0x80, \
  0x92, 0x40, \
  0xc9, 0x20

#define BurstMask11_4 \
  0x39, 0x00, \
  0x8a, 0x80, \
  0xc5, 0x40, \
  0x62, 0x20

#define BurstMask11_5 \
  0xc2, 0xc0, \
  0x61, 0x00, \
  0x30, 0xa0, \
  0x1c, 0x40, \
  0x85, 0x20

#define BurstMask11_6 \
  0x0e, 0x00, \
  0x82, 0x80, \
  0xc1, 0x40, \
  0x60, 0xa0, \
  0x30, 0x40, \
  0x18, 0x20

#define BurstMask11_7 \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x07, 0x00, \
  0x81, 0x40, \
  0xc0, 0xa0, \
  0x60, 0x40, \
  0x30, 0x20

#define BurstMask11_8 \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x40, \
  0x80, 0xa0, \
  0xc0, 0x40, \
  0x60, 0x20

#define BurstMask11_9 \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x80, 0x40, \
  0xc0, 0x20

#define BurstMask11_10 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x00, 0xc0, \
  0x80, 0x20

#define BurstMask11_11 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x00, 0xc0, \
  0x00, 0x60

#define BurstMask12_1 \
  0xff, 0xf0

#define BurstMask12_2 \
  0xaa, 0xa0, \
  0xd5, 0x50

#define BurstMask12_3 \
  0x92, 0x40, \
  0xc9, 0x20, \
  0x74, 0x90

#define BurstMask12_4 \
  0x8a, 0x80, \
  0xc5, 0x40, \
  0x62, 0x20, \
  0x39, 0x10

#define BurstMask12_5 \
  0x61, 0x00, \
  0x30, 0xa0, \
  0x1c, 0x50, \
  0x85, 0x20, \
  0xc2, 0x90

#define BurstMask12_6 \
  0x82, 0x90, \
  0xc1, 0x40, \
  0x60, 0xa0, \
  0x30, 0x50, \
  0x18, 0x20, \
  0x0c, 0x10

#define BurstMask12_7 \
  0x0c, 0x00, \
  0x07, 0x00, \
  0x81, 0x40, \
  0xc0, 0xa0, \
  0x60, 0x50, \
  0x30, 0x20, \
  0x18, 0x10

#define BurstMask12_8 \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x80, 0xa0, \
  0xc0, 0x50, \
  0x60, 0x20, \
  0x30, 0x10

#define BurstMask12_9 \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x80, 0x50, \
  0xc0, 0x20, \
  0x60, 0x10

#define BurstMask12_10 \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x00, 0xc0, \
  0x80, 0x20, \
  0xc0, 0x10

#define BurstMask12_11 \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x00, 0xc0, \
  0x00, 0x60, \
  0x80, 0x10

#define BurstMask12_12 \
  0x80, 0x00, \
  0xc0, 0x00, \
  0x60, 0x00, \
  0x30, 0x00, \
  0x18, 0x00, \
  0x0c, 0x00, \
  0x06, 0x00, \
  0x03, 0x00, \
  0x01, 0x80, \
  0x00, 0xc0, \
  0x00, 0x60, \
  0x00, 0x30

#define kPacketMaskBursty1 1, \
  BurstMask1_1

#define kPacketMaskBursty2 2, \
  BurstMask2_1, \
  BurstMask2_2

#define kPacketMaskBursty3 3, \
  BurstMask3_1, \
  BurstMask3_2, \
  BurstMask3_3

#define kPacketMaskBursty4 4, \
  BurstMask4_1, \
  BurstMask4_2, \
  BurstMask4_3, \
  BurstMask4_4

#define kPacketMaskBursty5 5, \
  BurstMask5_1, \
  BurstMask5_2, \
  BurstMask5_3, \
  BurstMask5_4, \
  BurstMask5_5

#define kPacketMaskBursty6 6, \
  BurstMask6_1, \
  BurstMask6_2, \
  BurstMask6_3, \
  BurstMask6_4, \
  BurstMask6_5, \
  BurstMask6_6

#define kPacketMaskBursty7 7, \
  BurstMask7_1, \
  BurstMask7_2, \
  BurstMask7_3, \
  BurstMask7_4, \
  BurstMask7_5, \
  BurstMask7_6, \
  BurstMask7_7

#define kPacketMaskBursty8 8, \
  BurstMask8_1, \
  BurstMask8_2, \
  BurstMask8_3, \
  BurstMask8_4, \
  BurstMask8_5, \
  BurstMask8_6, \
  BurstMask8_7, \
  BurstMask8_8

#define kPacketMaskBursty9 9, \
  BurstMask9_1, \
  BurstMask9_2, \
  BurstMask9_3, \
  BurstMask9_4, \
  BurstMask9_5, \
  BurstMask9_6, \
  BurstMask9_7, \
  BurstMask9_8, \
  BurstMask9_9

#define kPacketMaskBursty10 10, \
  BurstMask10_1, \
  BurstMask10_2, \
  BurstMask10_3, \
  BurstMask10_4, \
  BurstMask10_5, \
  BurstMask10_6, \
  BurstMask10_7, \
  BurstMask10_8, \
  BurstMask10_9, \
  BurstMask10_10

#define kPacketMaskBursty11 11, \
  BurstMask11_1, \
  BurstMask11_2, \
  BurstMask11_3, \
  BurstMask11_4, \
  BurstMask11_5, \
  BurstMask11_6, \
  BurstMask11_7, \
  BurstMask11_8, \
  BurstMask11_9, \
  BurstMask11_10, \
  BurstMask11_11

#define kPacketMaskBursty12 12, \
  BurstMask12_1, \
  BurstMask12_2, \
  BurstMask12_3, \
  BurstMask12_4, \
  BurstMask12_5, \
  BurstMask12_6, \
  BurstMask12_7, \
  BurstMask12_8, \
  BurstMask12_9, \
  BurstMask12_10, \
  BurstMask12_11, \
  BurstMask12_12

// choose first idx of packet mask according to k value (source number)
const uint8_t xqc_rnd_pm_tbl[] = {
    12,
    RandomPacketMask1,  // 2 byte entries.
    RandomPacketMask2,
    RandomPacketMask3,
    RandomPacketMask4,
    RandomPacketMask5,
    RandomPacketMask6,
    RandomPacketMask7,
    RandomPacketMask8,
    RandomPacketMask9,
    RandomPacketMask10,
    RandomPacketMask11,
    RandomPacketMask12,
};

const uint8_t xqc_bst_pm_tbl[] = {
    12,
    kPacketMaskBursty1,
    kPacketMaskBursty2,
    kPacketMaskBursty3,
    kPacketMaskBursty4,
    kPacketMaskBursty5,
    kPacketMaskBursty6,
    kPacketMaskBursty7,
    kPacketMaskBursty8,
    kPacketMaskBursty9,
    kPacketMaskBursty10,
    kPacketMaskBursty11,
    kPacketMaskBursty12,
};
